Skip to content

Transformation function to turn FDEs into ODEs #3776

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 14 commits into
base: master
Choose a base branch
from

Conversation

fchen121
Copy link
Contributor

Created a function for transformation addressed in #3707 using the methods described in https://arxiv.org/pdf/2506.04188.
Works for the first two examples of numerical experiments, but doesn't work for simple cases like x^2.

sys = fractional_to_ordinary(eqs, x, α, 10^-7, 1)

prob = ODEProblem(sys, [], tspan)
sol = solve(prob, radau5(), abstol = 1e-10, reltol = 1e-10)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
sol = solve(prob, radau5(), abstol = 1e-10, reltol = 1e-10)
sol = solve(prob, radau5(), saveat=time, abstol = 1e-10, reltol = 1e-10)

rhs += value * t^(index - 1) / gamma(index)
end
for index in range(M, N-1; step=1)
new_z = Symbol(:z, :_, i)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use a unicode piece so this doesn't clash with a user chosen name

```
"""
function fractional_to_ordinary(eqs, variables, alphas, epsilon, T; initials = 0)
@independent_variables t
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should just be the same as the main t. @AayushSabharwal what's the quick way to check the eqs all match?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That they have the same indepvar? check_equations(eqs, iv).

alpha_0 = α - m + 1
end

δ = (gamma(alpha_0+1) * epsilon)^(1/alpha_0)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

gamma isn't defined?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Gamma should be the gamma function from SpecialFunctions.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🤦 ahhh makes sense.

sol = solve(prob, radau5(), abstol = 1e-5, reltol = 1e-5)
```
"""
function linear_fractional_to_ordinary(degrees, coeffs, rhs, epsilon, T; initials = 0)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

how does this differ from just defining D.(u, alpha) ~ A*u and calling the first one?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is made for FDE with multiple fractional terms in a single equation, which the first one can't handle. On the other hand, this one doesn't work for non-linear DE.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants